package com.hellobike.haxing.modules.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.hellobike.haxing.modules.product.TreeNode;
import com.hellobike.haxing.modules.product.entity.Category;

import java.util.List;

/**
 * @Description: 后台分类
 * @Author: haxing-boot
 * @Date:   2020-01-11
 * @Version: V1.0
 */
public interface ICategoryService extends IService<Category> {

	/**根节点父ID的值*/
	public static final Long ROOT_PID_VALUE = 0L;
	
	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";
	
	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**新增节点*/
	void addCategory(Category category);
	
	/**修改节点*/
	void updateCategory(Category category) throws RuntimeException;
	
	/**删除节点*/
	void deleteCategory(Long id) throws RuntimeException;

	/**
	 * 获取后台类目树
	 * @return
	 */
	List<TreeNode> getAllTree();
	public List<TreeNode> getCategoryByCache(Long level);
}
